package com.group10.controller;

import com.group10.entity.Result;
import com.group10.service.impl.ShowServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/show")
public class ShowController {

    @Autowired
    private ShowServiceImpl showService;

    @GetMapping("/getAllShow")
    public Result<?> getAllShow(Integer pageNum, Integer pageSize){
        return showService.getAllShow(pageNum,pageSize);
    }

    @GetMapping("/getShowById")
    public Result<?> getShowById(Integer id){
        return showService.getShowById(id);
    }

    @GetMapping("/getShowByClassify")
    public Result<?> getShowByClassify(String classify){
        return showService.getShowByClassify(classify);
    }

    @PostMapping("/insertShow")
    public Result<?> insertShow(String detail,String url,String classify){
        return showService.insertShow(detail,url,classify);
    }

    @PutMapping("/deleteShow")
    public Result<?> deleteShow(Integer id){
        return showService.deleteShow(id);
    }
}
